package com.service.impl;

import com.dao.MenuMapper;
import com.dao.OperatorMapper;
import com.entity.Menu;
import com.entity.Operator;
import com.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by jsb-160 on 2018/7/18.
 */
@Service("Menu")
public class MenuServiceImpl implements MenuService {
    @Autowired
    MenuMapper menuMapper;

    @Override
    public List<Menu> liseMenuByPid(Integer pid,Integer id) {
        return menuMapper.liseMenuByPid(pid, id);
    }

    @Override
    public List<Menu> selectListMenuByPid(Integer pid) {
        return menuMapper.selectListMenuByPid(pid);
    }

    @Override
    public List<Menu> selectListMenu() {
        return menuMapper.selectListMenu();
    }

    @Override
    public List<Menu> liseMenu(Integer id) {
        return menuMapper.liseMenu(id);
    }

    @Override
    public Integer addMenu(Menu menu) {
        return menuMapper.insert(menu);
    }

    @Override
    public Integer updateMenu(Menu menu) {
        return menuMapper.updateByPrimaryKeySelective(menu);
    }

    @Override
    public Menu selectMenuById(Integer id) {
        return menuMapper.selectByPrimaryKey(id);
    }


}
